package com.jbp.service.impl;

import com.jbp.dao.PrizePoolDao;
import com.jbp.model.PrizePool;
import com.jbp.service.PrizePoolService;
import org.springframework.stereotype.Service;

import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jbp.utils.PageUtils;
import com.jbp.utils.Query;

@Service
public class PrizePoolServiceImpl extends ServiceImpl<PrizePoolDao, PrizePool> implements PrizePoolService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<PrizePool> page = this.page(
                new Query<PrizePool>().getPage(params),
                new QueryWrapper<PrizePool>()
        );

        return new PageUtils(page);
    }

    @Override
    public Integer getMaxPrizeNum() {
        return baseMapper.getMaxPrizeNum();
    }

    @Override
    public Integer bulkInsert(LinkedList<Integer> list, Integer prizeId) {
        return baseMapper.bulkInsert(list,prizeId);
    }

    @Override
    public Integer delPool(List<PrizePool> prPol) {
        return baseMapper.delPool(prPol);
    }

    @Override
    public List<PrizePool> getPoolList(Integer prizeDeployId, Integer type) {
        return baseMapper.getPoolList(prizeDeployId,type);
    }
}
